<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生命周期探索</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="case10-demo1">
    {{message}}
</div>
<script type="text/javascript">
    var case10Demo1 = new Vue({
        el: "#case10-demo1",
        data: {
            message: "slsher"
        },
        beforeCreate: function () {
            console.log("beforeCreate 创建前状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)//undefined
            console.log("%c%s", "color:red", "data    :" + this.$data)//undefined
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        created: function () {
            console.log("created 创建完毕状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        beforeMount: function () {
            console.log("beforeMount 挂载前状态==============>")
            console.log("%c%s", "color:red", "el    :" + (this.$el))
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        mounted: function () {
            console.log("mounted 挂载结束状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        beforeUpdate: function () {
            console.log("beforeUpdate 更新前状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        updated:function () {
            console.log("updated 更新完成状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        beforeDestroy:function() {
            console.log("beforeDestory 销毁前状态==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        },
        destroyed:function () {
            console.log("destroyed 销毁完成转台==============>")
            console.log("%c%s", "color:red", "el    :" + this.$el)
            console.log(this.$el)
            console.log("%c%s", "color:red", "data    :" + this.$data)
            console.log("%c%s", "color:red", "message    :" + this.message)
        }
    })
</script>
</body>
</html>